<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>

    <!-- Bootstrap -->
    <link href="<?=base_url();?>/public/resource/default/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="<?=base_url();?>/public/resource/default/vendor/bs3editable/css/bootstrap-editable.css" rel="stylesheet" >

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link href="<?=base_url();?>/public/resource/default/css/style.css" rel="stylesheet" >
    <style>
        .bs-glyphicons-list {
            list-style: outside none none;
            padding-left: 0;
            max-height: 300px;
            overflow-y: auto;
        }

        .bs-glyphicons li {
            background-color: #f9f9f9;
            border: 1px solid #fff;
            display: inline-block;
            font-size: 10px;
            padding: 5px 0;
            line-height: 1.4;
            text-align: center;
            width: 11%;
        }

        .bs-glyphicons li:hover,
        .bs-glyphicons li:focus {
            background: #31708f;
            color: #fff;
            cursor: pointer;
        }

        .bs-glyphicons .glyphicon {
            font-size: 24px;
            margin-bottom: 10px;
            margin-top: 5px;
        }
    </style>

</head>
<body>




    <div class="container-fluid wp-content">

        <div class="wp-content-mbx">
            <a><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span></a>
            <div>
                <span class="mainhead">菜单管理</span>
                <span class="subhead">编辑修改菜单选项</span>
            </div>
        </div>

        <div class="">

            <!-- Nav tabs -->
            <ul class="nav nav-tabs nav-hidden" role="tablist">
                <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">菜单管理</a></li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="home">
                    <!-- 操作提示框 -->
                    <div class="alert alert-danger alert-dismissible" role="alert">
                        <strong>Warning!</strong> Better check yourself, you're not looking too good.
                    </div>

                    <div class="row">
                        <div class="col-sm-4 col-md-4">
                            <div class="wp-panel panel-default">
                                <div class="wp-panel-heading">
                                    <span class="wp-h-mainhead">添加菜单</span>
                                </div>
                                <div class="wp-panel-body">
                                    <form id="add-menu-fm">
                                        <div class="form-group">
                                            <label for="iptMenuName">菜单名称</label>
                                            <input class="form-control" id="iptMenuName" type="text" name="name" placeholder="菜单名称">
                                        </div>
                                        <div class="form-group">
                                            <label for="">父级菜单</label>
                                            <select class="form-control" name="parent">
                                                <option value="">作为顶级菜单</option>
                                                <?php foreach ($menu as $item): ?>
                                                <option value="<?=$item['id']?>"><?=$item['name']?></option>
                                                <?php endforeach;?>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="iptUrl">菜单Url</label>
                                            <input class="form-control" id="iptUrl" type="text" name="url" placeholder="菜单URL">
                                            <p class="help-block">单击菜单时跳转的URL,格式如下：controller/action 或者 http://域名.</p>
                                        </div>
                                        <div class="form-group">
                                            <label for="iptIcon">图标样式</label>
                                            <input class="form-control" id="iptIcon" type="text" name="icon" value="" aria-describedby="inputGroupSuccess1Status" onclick="$('#iconModel').modal('toggle');">
                                            <p class="help-block">如果是最左侧的菜单,您需要为它指定一个图标样式.</p>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="target" id="" value="workspace" checked>
                                                在框架中代开
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="target" id="" value="_blank">
                                                在新的浏览器窗口中打开
                                            </label>
                                        </div>

                                        <button type="button" class="btn btn-default" onclick="fun_add_menu();">提交</button>
                                    </form>
                                    <div>

                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-8 col-md-8">
                            <div class="wp-panel panel-default">

                                <div class="wp-panel-heading">
                                    <span class="wp-h-mainhead">菜单列表</span>
                                    <span class="wp-h-subhead">共 99 条记录</span>
                                    <span class="wp-h-action">
                                        <a><span class="glyphicon glyphicon-repeat" aria-hidden="true"></span></a>
                                        <a><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></a>
                                    </span>
                                </div>

                                <div class="wp-panel-tool">
                                    <div class="pull-right">
                                        <input type="text" class="dd-form-control" />
                                        <button class="btn btn-sm btn-default">搜索</button>
                                    </div>
                                    <div>
                                        <select class="dd-form-control" name="action">
                                            <option value="">批量操作</option>
                                            <option value="del">删除</option>
                                        </select>
                                        <button class="btn btn-sm btn-default" onclick="fun_do_action();">确认</button>
                                    </div>
                                    <i class="clearfix"></i>
                                </div>

                                <div class="wp-panel-body">
                                    <div class="table-responsive">
                                        <table class="table table-hover wp-table">
                                            <thead>
                                            <tr>
                                                <th width="40"><input id="checkAll" type="checkbox" value=""></th>
                                                <th>菜单名称</th>
                                                <th>菜单url</th>
                                                <th>打开方式</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach ($menu as $item): ?>
                                            <tr>
                                                <td class="td-check"><input name="check" type="checkbox" value="<?=hashids_encode($item['id']);?>"></td>
                                                <td>
                                                    <strong><?=$item['name'];?></strong>
                                                    <br>
                                                    <div class="row-action">
                                                        <span><a href="<?=site_url(array('menu','edit',hashids_encode($item['id'])))?>">快速编辑</a></span> &Iota;
                                                        <span><a class="action-danger" href="javascript:fun_del_menu('<?=hashids_encode($item['id']);?>');">删除</a></span> &Iota;
                                                        <span><a href="<?=$item['url']?>" target="<?=$item['target']?>">查看</a></span>
                                                    </div>
                                                </td>
                                                <td><?=$item['url'];?></td>
                                                <td><?=$item['target'];?></td>
                                            </tr>
                                            <?php endforeach;?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>
    </div>


    <!-- 图表选择 Modal -->
    <div class="modal fade" id="iconModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">选择一个图标</h4>
                </div>
                <div class="modal-body">
                    <div class="bs-glyphicons">
                        <ul class="bs-glyphicons-list">

                            <li>
                                <span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-euro" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-eur" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-minus" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-cloud" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-glass" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-music" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-heart" aria-hidden="true"></span>
                            <li>
                                <span class="glyphicon glyphicon-star" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-film" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-signal" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-home" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-time" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-road" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-download" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-upload" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-inbox" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-flag" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-headphones" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-volume-off" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-volume-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-volume-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-barcode" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tag" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tags" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-book" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-print" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-camera" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-font" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bold" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-italic" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-text-height" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-text-width" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-align-center" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-align-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-list" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-indent-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-indent-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-facetime-video" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-picture" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-adjust" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tint" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-share" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-check" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-move" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-step-backward" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-backward" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-play" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-pause" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-stop" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-forward" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-step-forward" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-eject" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-screenshot" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ban-circle" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-resize-full" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-resize-small" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-gift" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-fire" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-plane" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-random" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-comment" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-magnet" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-retweet" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-resize-vertical" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-resize-horizontal" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hdd" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bullhorn" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bell" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-certificate" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-thumbs-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hand-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hand-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hand-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-circle-arrow-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-circle-arrow-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tasks" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-dashboard" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-paperclip" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-heart-empty" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-link" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-phone" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-usd" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-gbp" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort-by-alphabet" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort-by-alphabet-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort-by-order" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort-by-order-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort-by-attributes" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sort-by-attributes-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-unchecked" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-expand" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-collapse-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-log-in" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-flash" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-record" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-save" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-open" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-saved" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-export" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-send" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-floppy-saved" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-floppy-remove" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-floppy-open" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-credit-card" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-transfer" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-cutlery" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-header" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-compressed" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-earphone" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-phone-alt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tower" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-stats" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sd-video" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hd-video" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-subtitles" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sound-stereo" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sound-dolby" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sound-5-1" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sound-6-1" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sound-7-1" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-registration-mark" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tree-conifer" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tree-deciduous" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-cd" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-save-file" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-open-file" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-level-up" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-copy" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-paste" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-king" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-queen" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-pawn" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bishop" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-knight" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-baby-formula" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-tent" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-blackboard" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bed" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-apple" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-erase" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-lamp" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-piggy-bank" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-scissors" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-bitcoin" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-btc" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-xbt" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-yen" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-jpy" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ruble" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-rub" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-scale" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ice-lolly" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-ice-lolly-tasted" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-education" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-modal-window" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-oil" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-grain" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-text-size" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-text-color" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-object-align-top" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-object-align-bottom" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-object-align-horizontal" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-object-align-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-object-align-vertical" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-object-align-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-triangle-top" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-console" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-superscript" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-subscript" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span>
                            </li>

                            <li>
                                <span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span>
                            </li>

                        </ul>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="<?=base_url();?>/public/resource/default/vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="<?=base_url();?>/public/resource/default/vendor/bs3editable/js/bootstrap-editable.min.js"></script>

    <script src="<?=base_url();?>/public/resource/default/js/init.js"></script>

    <script>

        $(function(){
            $('.bs-glyphicons-list > li').click(function(){
                // 获取选中的图表值
                var iconVal = $(this).children('span:first-child').attr('class');
                // 设置值
                $('#iptIcon').val(iconVal);
                // 关闭对话框
                $('#iconModel').modal('toggle');
            })

            $('#checkAll').click(function() {
                $('input[name="check"]').prop("checked",this.checked);
                var check = $("input[name='check']");
                check.click(function(){
                    $("#checkAll").prop("checked",check.length == $("input[name='check']:checked").length ? true : false);
                });
            });

        })


        /**
         * 添加菜单
         */
        function fun_add_menu()
        {
            $.ajax({
                url:     '<?=site_url('menu/add')?>',
                data:    $('#add-menu-fm').serialize(),
                type:    'post',
                async:   false,
                success: function(response){
                    var resp = eval('(' + response + ')');
                    if (resp.resultCode == CHttp.getConstant('HTTP_STATUS_SUCCESS'))
                    {
                        alert(resp.resultMsg);
                        location.reload();
                    }
                    else
                    {
                        alert(resp.resultMsg);
                    }
                },
                error: function(request){
                    alert('Error');
                }
            })
        }

        /**
         * 批量操作
         */
        function fun_do_action()
        {
            // 获取将要执行的操作
            var action = $('select[name="action"]').val();
            if (fun_empty(action))
            {
                alert('请选择一项操作');
                return;
            }

            // 获取checkbox的值
            var checkValues = '';
            $("input:checkbox[name='check']:checked").each(function(i){
                if(0==i){
                    checkValues = $(this).val();
                }else{
                    checkValues += (","+$(this).val());
                }
            });
            if (fun_empty(checkValues))
            {
                alert('请至少选择一条记录');
                return;
            }

            switch (action)
            {
                case 'del':
                    // 调用删除菜单方法
                    fun_del_menu(checkValues);
                    break;
                default :
                    break;
            }
        }


        /**
         * 删除菜单
         *
         * @param id
         */
        function fun_del_menu(id)
        {

            if (confirm('谨慎操作,删除父级菜单后其下面的子菜单会自动上移一层'))
            {
                $.post(
                    '<?=site_url("menu/del");?>',
                    {id:id},
                    function(response){
                        alert(response.resultMsg);
                        if (response.resultCode == CHttp.getConstant('HTTP_STATUS_SUCCESS'))
                        {
                            location.reload();
                        }
                    },
                    'json'
                );
            }
        }

    </script>

</body>
</html>